﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net;

namespace Font_Processor
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            FontStyle num = (FontStyle)3;
        }


        private void LoadForm(Object sender, EventArgs args)
        {
            Font_Web_Service.FontSchema.StringMeasurementsDataTable fontsTable = new Font_Processor.Font_Web_Service.FontSchema.StringMeasurementsDataTable();

            for (int i = 0; i < 200; i++)
            {
                Font_Web_Service.FontSchema.StringMeasurementsRow fontRow = fontsTable.NewStringMeasurementsRow();
                fontRow.Bold = true;
                fontRow.Font = "HelveticaNeueLT Std Med Ext";
                fontRow.Italic = true;
                fontRow.Size = 18;
                fontRow.Ratio = .453;                
                fontRow.Text = "GUY'S BIG BITE";
                fontsTable.AddStringMeasurementsRow(fontRow);
            }

            Font_Web_Service.Font_Web_Service proxy = new Font_Processor.Font_Web_Service.Font_Web_Service();
            proxy.Credentials = CredentialCache.DefaultNetworkCredentials;

            try
            {
                Font_Web_Service.FontSchema.StringMeasurementsDataTable resultsTable = proxy.calculatePixelLengths(fontsTable, 1280, 1024);

                stringMeasurementsBindingSource.DataSource = resultsTable;
            }
            catch (Exception ex)
            {
                String err = ex.ToString();
            }


        }

    }
}
